<div class="el-dialog">
    <header class="el-dialog__header">
        <span  class="el-dialog__title">修改广告</span>
        <button  data-bs-dismiss="modal" aria-label="Close" class="el-dialog__headerbtn" type="button">
            <i class="el-icon el-dialog__close">
                <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
                    <path fill="currentColor" d="M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"></path>
                </svg>
            </i>
        </button>
    </header>
    <!--顶部-->
     <form method="post" onsubmit="return post_add(this,'{:url('edit')}')">
    <div class="el-dialog__body">
        <!--内容-->
       <div class="mb-3 row">
            <label class="col-sm-2 col-form-label">名称</label>
            <div class="col-sm-10">
              <input type="text" name="title" value="{$find.title}" class="form-control" placeholder="请输入广告名称">
            </div>
          </div>   
          
          <div class="mb-3 row">
            <label class="col-sm-2 col-form-label">分类</label>
            <div class="col-sm-10">
              <select class="form-select" name="type" aria-label="请选择广告类型">
                    <option value="1" {if $find.type == 1}selected=""{/if}>文字形式</option>
                    <option value="2" {if $find.type == 2}selected=""{/if}>HTML代码</option>
                    <option value="3" {if $find.type == 3}selected=""{/if}>图片形式</option>
                </select>
            </div>
          </div> 
          
          <div class="mb-3 row">
            <label class="col-sm-2 col-form-label">地址</label>
            <div class="col-sm-10">
              <input type="text" name="url" value="{$find.url}" class="form-control" placeholder="请输入链接地址">
            </div>
          </div> 
          
          <div class="mb-3 row">
            <label class="col-sm-2 col-form-label">开始</label>
            <div class="col-sm-10">
              <input type="text" name="start_time" id="start_time" value="{:date("Y-m-d H:i:s",$find.start_time)}" class="form-control" placeholder="请输入开始时间">
            </div>
          </div> 
          
          <div class="mb-3 row">
            <label class="col-sm-2 col-form-label">结束</label>
            <div class="col-sm-10">
              <input type="text" name="end_time" id="end_time" value="{:date("Y-m-d H:i:s",$find.end_time)}" class="form-control" placeholder="请输入结束时间">
            </div>
          </div> 
          
          <div class="mb-3 row">
            <label class="col-sm-2 col-form-label">图像</label>
            <div class="col-sm-10 input-group mb-3" style="width: 83.33333333%;">
              <input type="text" id="img" name="img" value="{$find.img}" class="form-control" placeholder="请输入选择图像">
               <button onclick="qh_open('图片管理','{:url('attachment/add',['name'=>'img'])}',700,500)" class="el-button el-button--primary" type="button">上传</button>
            </div>
          </div> 
          
          <div class="mb-3 row">
            <label class="col-sm-2 col-form-label">简介</label>
            <div class="col-sm-10">
              <textarea type="text" name="describe" class="form-control" placeholder="请输入简介">{$find.describe}</textarea>
            </div>
          </div> 
          
          <div class="mb-3 row">
            <label class="col-sm-2 col-form-label">广告值</label>
            <div class="col-sm-10">
             <textarea type="text" name="code"  class="form-control" placeholder="请输入广告值">{$find.code}</textarea>
            </div>
          </div> 
          
          
          <input type="hidden" name="__token__" value="{:token()}" />
          <input type="hidden" name="id" value="{$find.id}" />
         <!--内容-->
    </div>
    <!--底部-->
    <footer class="el-dialog__footer">
        <span class="dialog-footer">
            <button  type="button" class="el-button el-button--danger" data-bs-dismiss="modal" aria-label="Close">
                <span class="">取消</span></button>
            <button class="el-button el-button--primary" aria-disabled="false" type="submit">
                <span class="">确认</span></button>
        </span>
    </footer>
    </form>
</div>
<script>
layui.use(function(){
  var laydate = layui.laydate;
  // 日期时间选择器 - 日期和时间选择器同时显示（全面板）
  laydate.render({
    elem: '#start_time',
    type: 'datetime',
   });
  laydate.render({
    elem: '#end_time',
    type: 'datetime',
   });
  
});
</script>